LOOPS, PART 1: Run the program and watch the player overshoot the goal! Whoops!

  • Try changing the numbers in range() and in .move_right() to get the ball to stop in the net.
  • If you don't get it perfect, don't worry! There's an easier way. We will switch the for loop to a while loop!
  • Delete for·counter·in·range(100): and drag in While Less Than to replace it.
  • Change the variable counter to ball_x in three places: above the loop, in the loop condition, and in the loop.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)